﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using BlogEngine.Core;
using BlogEngine.Core.DataStore;
using BlogEngine.Core.Providers;


namespace BlogEngine.MongoDbProvider
{
    public class MongoDbProvider : BlogProvider
    {

        /// <summary>
        /// Retrieves a Post from the provider based on the specified id.
        /// </summary>
        public override Post SelectPost(Guid id)
        {
            var db = new MongoDb("BlogEngineTest");
            return db.SelectOne<Post>(p=> p.Id == id);
        }

        /// <summary>
        /// Inserts a new Post into the data store specified by the provider.
        /// </summary>
        public override void InsertPost(Post post)
        {
            var db = new MongoDb("BlogEngineTest");
            db.Insert(post);
            
        }

        /// <summary>
        /// Updates an existing Post in the data store specified by the provider.
        /// </summary>
        public override void UpdatePost(Post post)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Deletes a Post from the data store specified by the provider.
        /// </summary>
        public override void DeletePost(Post post)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Retrieves all Posts from the provider and returns them in a List.
        /// </summary>
        public override List<Post> FillPosts()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Retrieves a Page from the provider based on the specified id.
        /// </summary>
        public override Page SelectPage(Guid id)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Inserts a new Page into the data store specified by the provider.
        /// </summary>
        public override void InsertPage(Page page)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Updates an existing Page in the data store specified by the provider.
        /// </summary>
        public override void UpdatePage(Page page)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Deletes a Page from the data store specified by the provider.
        /// </summary>
        public override void DeletePage(Page page)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Retrieves all Pages from the provider and returns them in a List.
        /// </summary>
        public override List<Page> FillPages()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Retrieves a Page from the provider based on the specified id.
        /// </summary>
        public override AuthorProfile SelectProfile(string id)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Inserts a new Page into the data store specified by the provider.
        /// </summary>
        public override void InsertProfile(AuthorProfile profile)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Updates an existing Page in the data store specified by the provider.
        /// </summary>
        public override void UpdateProfile(AuthorProfile profile)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Deletes a Page from the data store specified by the provider.
        /// </summary>
        public override void DeleteProfile(AuthorProfile profile)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Retrieves all Pages from the provider and returns them in a List.
        /// </summary>
        public override List<AuthorProfile> FillProfiles()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Retrieves a Category from the provider based on the specified id.
        /// </summary>
        public override Category SelectCategory(Guid id)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Inserts a new Category into the data store specified by the provider.
        /// </summary>
        public override void InsertCategory(Category category)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Updates an existing Category in the data store specified by the provider.
        /// </summary>
        public override void UpdateCategory(Category category)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Deletes a Category from the data store specified by the provider.
        /// </summary>
        public override void DeleteCategory(Category category)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Retrieves all Categories from the provider and returns them in a List.
        /// </summary>
        public override List<Category> FillCategories()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Loads the settings from the provider.
        /// </summary>
        public override StringDictionary LoadSettings()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Saves the settings to the provider.
        /// </summary>
        public override void SaveSettings(StringDictionary settings)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Loads the ping services.
        /// </summary>
        /// <returns></returns>
        public override StringCollection LoadPingServices()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Saves the ping services.
        /// </summary>
        /// <param name="services">The services.</param>
        public override void SavePingServices(StringCollection services)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Loads the stop words used in the search feature.
        /// </summary>
        public override StringCollection LoadStopWords()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Loads settings from data store
        /// </summary>
        /// <param name="exType">Extension Type</param>
        /// <param name="exId">Extensio Id</param>
        /// <returns>Settings as stream</returns>
        public override object LoadFromDataStore(ExtensionType exType, string exId)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Saves settings to data store
        /// </summary>
        /// <param name="exType">Extension Type</param>
        /// <param name="exId">Extension Id</param>
        /// <param name="settings">Settings object</param>
        public override void SaveToDataStore(ExtensionType exType, string exId, object settings)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Removes settings from data store
        /// </summary>
        /// <param name="exType">Extension Type</param>
        /// <param name="exId">Extension Id</param>
        public override void RemoveFromDataStore(ExtensionType exType, string exId)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Retrieves a BlogRoll from the provider based on the specified id.
        /// </summary>
        public override BlogRollItem SelectBlogRollItem(Guid Id)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Inserts a new BlogRoll into the data store specified by the provider.
        /// </summary>
        public override void InsertBlogRollItem(BlogRollItem blogRollItem)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Updates an existing BlogRoll in the data store specified by the provider.
        /// </summary>
        public override void UpdateBlogRollItem(BlogRollItem blogRollItem)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Deletes a BlogRoll from the data store specified by the provider.
        /// </summary>
        public override void DeleteBlogRollItem(BlogRollItem blogRollItem)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Retrieves all BlogRolls from the provider and returns them in a list.
        /// </summary>
        public override List<BlogRollItem> FillBlogRoll()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Retrieves a Referrer from the provider based on the specified id.
        /// </summary>
        public override Referrer SelectReferrer(Guid Id)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Inserts a new Referrer into the data store specified by the provider.
        /// </summary>
        public override void InsertReferrer(Referrer referrer)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Updates an existing Referrer in the data store specified by the provider.
        /// </summary>
        public override void UpdateReferrer(Referrer referrer)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Deletes a Referrer from the data store specified by the provider.
        /// </summary>
        public override List<Referrer> FillReferrers()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override string StorageLocation()
        {
            throw new NotImplementedException();
        }
    }
}